<?php
namespace Guestbook\Model;
use Think\Model\ViewModel;

class MessageViewModel extends ViewModel{
  public $viewFields = array(
    'message' => array(
      'messageId',
      'content',
      'createdAt'
    ),
    'user'=>array(
      'userId',
      'username',
      '_on'=>'user.userId=message.userId'
    )
  );
}